package com.hrp.hrpdao;

import com.hrp.domain.Menus;
import com.hrp.domain.UimssVarieties;
import com.hrp.domain.Yydic;
import com.hrp.service.ReceiverInformation;
import com.hrp.service.SupplierInformatrion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/8/10 0010.
 */
@Mapper
public interface CommonDao {

    @Select("select * from YY_DIC where lbdm=#{lbdm}")
    List<Yydic> getYydicBylbdm(@Param("lbdm") String lbdm);

    @Select("select * from JX_KHZBK_TEMP_D where zqid=#{zqid}")
    List<Map<String,Object>> getLcjj(@Param("zqid") Integer zqid);

    @Select(" select * from YY_DIC where lbdm=#{lbdm} ")
    List<Yydic> getDicList(@Param("lbdm") String lbdm);

    //@Select(" select * from UIMSS_VARIETIES where name like '%${searchValue}%' ")
    @Select("<script>"
            + " select * from UIMSS_VARIETIES where name like '%${searchValue}%' and showFlag in "
            + "<foreach item='item' index='index' collection='showList' open='(' separator=',' close=')'>"
            + "#{item}"
            + "</foreach>"
            + "</script>")
    List<UimssVarieties> getUimssVarietiesDropList(@Param("searchValue") String searchValue,@Param("showList") List<Integer> showList);

    @Select(" select  id,name from UIMSS_SUPPLIERINFO where state=1  and name like '%${searchValue}%'")
    List<SupplierInformatrion> getUimssSupplierDropList(@Param("searchValue") String searchValue);


    @Select(" select id,name from UIMSS_RECEIVERINFO  where state=1  and name like '%${searchValue}%'")
    List<ReceiverInformation> getUimssReceiverDropList(@Param("searchValue") String searchValue);
}
